package org.gy.T9;

import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.nio.charset.Charset;

public class PrintTest1 {
    public static void main(String[] args) {
        try (
// 1、创建⼀个打印流管道
// PrintStream ps =
// new PrintStream("io-app2/src/itheima08.txt",Charset.forName("GBK"));
// PrintStream ps =
// new PrintStream("io-app2/src/itheima08.txt");
        PrintWriter ps =
                new PrintWriter(new FileOutputStream("C:/file-io-app2/src/itheima08.txt", true));
         ){
            ps.print(97); //⽂件中显示的就是:97
            ps.print('a'); //⽂件中显示的就是:a
            ps.println("我爱你中国abc"); //⽂件中显示的就是:我爱你中国abc
            ps.println(true);//⽂件中显示的就是:true
            ps.println(99.5);//⽂件中显示的就是99.5
            ps.write(97); //⽂件中显示a，发现和前⾯println⽅法的区别了吗？
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
